﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;

namespace ATM.Core.Infrastructure.DependencyInjection
{
    public class ServiceResolver : IServiceResolver
    {
        private static IWindsorContainer container;

        public ServiceResolver()
        {
            container = new WindsorContainer();
        }

        public void AddComponent<Interface, Implementation>(string Key)
        {
            container.AddComponent(Key, typeof(Interface), typeof(Implementation));
        }

        public T Resolve<T>()
        {
            return container.Resolve<T>();
        }


    }
}
